fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

unicode_categories

unicode_categories

unicode_categories -- unit feature to group the values of the Unicode
General_Category property

Each inner feature is one value of the General_Category property, see
https://www.unicode.org/reports/tr44/#General_Category_Values. The names
are the long property value aliases from PropertyValueAliases.txt in
snake_case, `as_string` gives the short alias (e.g. "Lu").

Constructors

Pe: Punctuation, close -- a closing punctuation mark (of a pair)
Pc: Punctuation, connector -- a connecting punctuation mark, like a tie
Cc: Other, control -- a C0 or C1 control code
Sc: Symbol, currency -- a currency sign
Pd: Punctuation, dash -- a dash or hyphen punctuation mark
Nd: Number, decimal digit -- a decimal digit
Me: Mark, enclosing -- an enclosing combining mark
Pf: Punctuation, final quote -- a final quotation mark
Cf: Other, format -- a format control character
Pi: Punctuation, initial quote -- an initial quotation mark
Nl: Number, letter -- a letterlike numeric character
Zl: Separator, line -- U+2028 LINE SEPARATOR only
Ll: Letter, lowercase -- a lowercase letter
Sm: Symbol, math -- a symbol of mathematical use
Lm: Letter, modifier -- a modifier letter
Sk: Symbol, modifier -- a non-letterlike modifier symbol
Mn: Mark, nonspacing -- a nonspacing combining mark (zero advance width)
Ps: Punctuation, open -- an opening punctuation mark (of a pair)
Lo: Letter, other -- other letters, including syllables and ideographs
No: Number, other -- a numeric character of other type
Po: Punctuation, other -- a punctuation mark of other type
So: Symbol, other -- a symbol of other type
Zp: Separator, paragraph -- U+2029 PARAGRAPH SEPARATOR only
Co: Other, private use -- a private-use character
Zs: Separator, space -- a space character (of various non-zero widths)
Mc: Mark, spacing combining -- a spacing combining mark (positive advance width)
Cs: Other, surrogate -- a surrogate code point
Lt: Letter, titlecase -- a digraph whose first part is uppercase
Cn: Other, not assigned -- a reserved unassigned code point or a noncharacter
Lu: Letter, uppercase -- an uppercase letter

Functions

 => 
String
[Inherited from  Any]
create a String from this instance. Unless redefined, `a.as_string` will
create `"instance[T]"` where `T` is the dynamic type of `a`
(R 
type
, F 
type
: Typed_Function R, f F)
 => 
R
[Inherited from  Any]
dynamic_apply -- apply `f.call` to `Any.this`'s dynamic type and value

This can be used to perform operation on values depending on their dynamic
type.

Here is an example that takes a `Sequence Any` that may contain boxed values
of types `i32` and `f64`. We can now write a feature `get_f64` that extracts
these values converted to `f64` and build a function `sum` that sums them up
as follows:


 => 
Type
[Inherited from  Any]
Get the dynamic type of this instance. For value instances `x`, this is
equal to `type_of x`, but for `x` with a `ref` type `x.dynamic_type` gives
the actual runtime type, while `type_of x` results in the static
compile-time type.

There is no dynamic type of a type instance since this would result in an
endless hierarchy of types. So for Type values, dynamic_type is redefined
to just return Type.type.
 => 
String
[Inherited from  Any]
convenience prefix operator to create a string from a value.

This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.

Type Features

 => 
String
[Inherited from  Type]
string representation of this type to be used for debugging.

result has the form "<name>", but this might change in the future

redefines:

 => 
Type
[Inherited from  Type]
There is no dynamic type of a type instance since this would result in an
endless hierarchy of types, so dynamic_type is redefined to just return
Type.type here.

Note: Typechecking is undecidable when 'type' is a type, Mark B. Reinhold, 1989
see: https://dspace.mit.edu/bitstream/handle/1721.1/149366/MIT-LCS-TR-458.pdf?sequence=6

redefines:

(T 
type
)
 => 
bool
[Inherited from  Type]
Is this type assignable to a type parameter with constraint `T`?

The result of this is a compile-time constant that can be used to specialize
code for a particular type.


it is most useful in conjunction with preconditions or `if` statements as in


or

 => 
String
[Inherited from  Type]
name of this type, including type parameters, e.g. 'option (list i32)'.
 => 
String
[Inherited from  Type]
convenience prefix operator to create a string from a value.

This permits usage of `$` as a prefix operator in a similar way both
inside and outside of constant strings: $x and "$x" will produce the
same string.

NYI: Redefinition allows the type feature to be distinguished from its normal counterpart, see #3913

redefines:

 => 
Type
[Inherited from  Any]
Get a type as a value.

This is a feature with the effect equivalent to Fuzion's `expr.type` call tail.
It is recommended to use `expr.type` and not `expr.type_value`.

`type_value` is here to show how this can be implemented and to illustrate the
difference to `dynamic_type`.
0.099dev (GIT hash a68bce9af280552faedee34cd5433dc10b6454de)
last changed: 2026-10-14